//
//  NotifacationsType.swift
//  DaRings
//
//  Created by 尹琼 on 2022/11/10.
//

import UIKit


public enum NotifactionType: String, CaseIterable {
    
    case deviceState = "deviceState"
    case bluetoothState = "bluetoothState"
    case sleep = "sleep"
    case temperature = "temperature"
    case activity = "activity"
    case heartRate = "heartRate"
    case singleHeartRate = "singleHeartRate"
    case realTimeHeartRate = "realTimeHeartRate"
    case HRV = "HRV"
    case singleHRV = "singleHRV"
    case stress = "stress"
    case singleStress = "singleStress"
    case bloodOxygen = "bloodOxygen"
    case singleBloodOxygen = "singleBloodOxygen"
    case upgrede = "upgrede"
    case sportList = "sportList"
    case sportState = "sportState"
    case battery = "battery"
    case reminder = "reminder"
    
}

public extension NotifactionType {
    
    static func type(of name: Notification.Name) ->NotifactionType? {
        
        switch name {
            
        case Notification.Name.kDeviceStateNotification:
            return .deviceState
            
        case Notification.Name.kBluetoothStateNotification:
            return .bluetoothState
            
        case Notification.Name.kReceiveSleepNotification:
            return .sleep
            
        case Notification.Name.kReciiveTemperatureNotification:
            return .temperature
            
        case Notification.Name.kReceiveStepsNotification:
            return .activity
            
        case Notification.Name.kReceiveHeartRateNotification:
            return .heartRate
            
        case Notification.Name.kReceiveSingleHeartRateNotification:
            return .singleHeartRate
            
        case Notification.Name.kReceiveRealTimeHeartRateNotification:
            return .realTimeHeartRate
            
        case Notification.Name.kReceiveHRVNotification:
            return .HRV
            
        case Notification.Name.kReceiveSingleHRVNotification:
            return .singleHRV
            
        case Notification.Name.kReceiveStressNotification:
            return .stress
            
        case Notification.Name.kReceiveSingleStressNotification:
            return .singleStress
            
        case Notification.Name.kReceiveSpO2Notification:
            return .bloodOxygen
            
        case Notification.Name.kReceiveSingleSpO2Notification:
            return .singleBloodOxygen
            
        case Notification.Name.kReceiveUpgredeNotification:
            return .upgrede
            
        case Notification.Name.kReceiveSportListNotification:
            return .sportList
            
        case Notification.Name.kReceiveSportStateInfoNotification:
            return .sportState
            
        case Notification.Name.kBatteryNotification:
            return .battery
            
        case Notification.Name.kActivityReminderInfoNotification:
            return .reminder
        default:
            return nil
        }
        
    }
    
    var name: Notification.Name {
        
        switch self {
            
        case .deviceState:
            return .kDeviceStateNotification
            
        case .bluetoothState:
            return .kBluetoothStateNotification
            
       
        case .activity:
            return .kReceiveStepsNotification
            
        case .heartRate:
            return .kReceiveHeartRateNotification
            
        case .realTimeHeartRate:
            return .kReceiveRealTimeHeartRateNotification
            
        case .HRV:
            return .kReceiveHRVNotification
            
        case .stress:
            return .kReceiveStressNotification
            
        case .bloodOxygen:
            return .kReceiveSpO2Notification
            
        case .upgrede:
            return .kReceiveUpgredeNotification
            
        case .sportList:
            return .kReceiveSportListNotification
            
        case .sportState:
            return .kReceiveSportStateInfoNotification
            
        case .sleep:
            return .kReceiveSleepNotification
            
        case .temperature:
            return .kReciiveTemperatureNotification
            
        case .singleHeartRate:
            return .kReceiveSingleHeartRateNotification
            
        case .singleHRV:
            return .kReceiveSingleHRVNotification
        case .singleStress:
            return .kReceiveSingleStressNotification
        case .singleBloodOxygen:
            return .kReceiveSingleSpO2Notification
        case .battery:
            return .kBatteryNotification
        case .reminder:
            return .kActivityReminderInfoNotification
        }
        
    }
    
}




